package com.example.blog.common.security;

import org.springframework.security.access.prepost.PreAuthorize;

import java.lang.annotation.*;

@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
@PreAuthorize("hasAuthority(#root.target.getClass().getSimpleName() + ':' + #root.methodName)")
public @interface HasPermission {
    
    /**
     * 所需权限
     */
    String value() default "";
} 